package com.alangyun.remind.repository.algorithm;

/**
 * 绩效得分
 *
 * @class com.alangyun.remind.repository.algorithm.Perfomance
 * @company 北京诚朗信息技术有限公司
 * @author hoobort klxukun@126.com
 * @datetime 2022年11月23日 下午4:38:17
 *
 */
public enum Perfomance implements IFactorEnum {
	CP6("6分", 6,	2, 0.0, 0.0),
	CP55("5.5分",5.5,1.5, 0.0, 0.0),
	CP5("5分",5,1.2, 0.0, 0.0),
	CP45("4.5分",4.5,1, 0.0, 0.0),
	CPL45("4.5分以下",4,0.8, 0.0, 0.0);


	private String keyCode;
	private double selfVal;
	private double standVal;
	private double minVal;
	private double maxVal;

	private Perfomance(String k, double self, double standard, double min, double max) {
		this.keyCode = k;
		this.standVal = standard;
		this.minVal = min;
		this.maxVal = max;
		this.selfVal= self;
	}

	public String key() {
		return keyCode;
	}

	public double standard() {
		return standVal;
	}

	public double min() {
		return minVal;
	}

	public double max() {
		return maxVal;
	}

	public double getSelfVal() {
		return selfVal;
	}

	public static Perfomance keyOf(String key) {
		Perfomance ret=CPL45;
		if(key==null||key.length()==0)
			return ret;
		
		if(CP6.key().equals(key))
			ret=CP6;
		else if(CP55.key().equals(key))
			ret=CP55;
		else if(CP5.key().equals(key))
			ret=CP5;
		else if(CP45.key().equals(key))
			ret=CP45;
		else if(CPL45.key().equals(key))
			ret=CPL45;
		
		return ret;
	}
}
